# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/20 21:20
from PyQt5.Qt import *

class Label(QLabel):
	def minimumSizeHint(self):
		return QSize(150,60)

class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('布局管理器学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		label1 = QLabel('标签1')
		label1.setStyleSheet('background-color:cyan')
		label2 = QLabel('标签2')
		label2.setStyleSheet('background-color:yellow')
		label3 = QLabel('标签3')
		label3.setStyleSheet('background-color:red')
		label4 = QLabel('标签4')
		label4.setStyleSheet('background-color:orange')

		layout = QVBoxLayout()
		self.setLayout(layout)

		layout.addWidget(label1)
		layout.addWidget(label2)
		layout.addWidget(label3)
		# QSizePolicy

		# label1.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed)
		# label1.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Minimum)
		label1.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Ignored)
		# label2.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)


if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())